//package com.play.ballen.home.ui
//
//import android.content.Context
//import android.content.Intent
//import android.os.Build
//import android.text.Editable
//import androidx.annotation.RequiresApi
//import com.play.ballen.R
//import com.play.ballen.databinding.ActivityDialogKeyboardBinding
//import com.play.ballen.event.EventCost
//import com.play.ballen.home.vm.PLPFragmentVM
//import com.play.ballen.widget.emoji.FaceTextUtil
//import com.yuven.baselib.component.BaseMVVMActivity
//import com.yuven.baselib.component.eventbus.Event
//import com.yuven.baselib.component.eventbus.EventBusUtil
//import org.kymjs.chat.OnOperationListener
//import org.kymjs.chat.bean.Emojicon
//import org.kymjs.chat.bean.Faceicon
//import org.kymjs.chat.emoji.DisplayRules
//import java.io.File
//
//
//class CommenKeyboardActivity : BaseMVVMActivity<PLPFragmentVM, ActivityDialogKeyboardBinding>() {
//
//    private var longitude = 0.0
//    private var latitude = 0.0
//
//    var moment_id = 0//回复某评论填该评论id, 否则填0
//    var parent_id = 0//父评论的id, 没有填0
//    var target_id = 0//回复某评论填该评论id, 否则填0
//    var reply_person = ""
//    var cont= ""
//    override fun layoutId(): Int {
//        return R.layout.activity_dialog_keyboard
//    }
//
//    override fun viewModelClass(): Class<PLPFragmentVM> {
//        return PLPFragmentVM::class.java
//    }
//
//    companion object {
//        @JvmStatic
//        fun start(context: Context,moment_id:Int,parent_id:Int,target_id:Int,reply_person:String) {
//            val starter = Intent(context, CommenKeyboardActivity::class.java)
//            starter.putExtra("moment_id", moment_id)
//            starter.putExtra("parent_id", parent_id)
//            starter.putExtra("target_id", target_id)
//            starter.putExtra("reply_person", reply_person)
//            context.startActivity(starter)
//        }
//    }
//
//    override fun initIntent(intent: Intent?) {
//        if (intent != null) {
//            moment_id = intent.getIntExtra("moment_id",0)
//            parent_id = intent.getIntExtra("parent_id",0)
//            target_id = intent.getIntExtra("target_id",0)
//            reply_person = intent.getStringExtra("reply_person").toString()
//        }
//    }
//
//    @RequiresApi(Build.VERSION_CODES.O)
//    override fun initObserver() {
//        super.initObserver()
//
//    }
//
//    override fun initView() {
//    }
//
//    override fun initData() {
//
//        if(reply_person.isNotEmpty()){
//            dataBinding.chatMsgInputBox.setCommentPerson("回复@"+reply_person)
//        }
//
//        dataBinding.llContent.setOnClickListener{
////            dataBinding.chatMsgInputBox.hideKeyboard(mContext)
//            finish()
//        }
//        dataBinding.chatMsgInputBox.setOnOperationListener(object : OnOperationListener {
//            override fun send(content: String) {
//                cont = content
//                val map = mutableMapOf<String, Any>()
//                map["moment_id"] = moment_id
//                map["parent_id"] = parent_id
//                map["target_id"] = target_id
//                map["content"] = cont
//                map["longitude"] = longitude
//                map["latitude"] = latitude
//                viewModel.addComment(map)
//            }
//
//            override fun selectedFace(content: Faceicon) {
//
//            }
//
//            override fun selectedEmoji(str: String?, faceImageRes: Int) {
//                val editable: Editable = dataBinding.chatMsgInputBox.editTextBox.getText()
//                editable.insert(
//                    dataBinding.chatMsgInputBox.editTextBox.getSelectionStart(),
//                    FaceTextUtil.getFaceImageSpan(str, faceImageRes)
//                )
//            }
////
////            override fun selectedEmoji(emoji: Emojicon) {
////
////            }
//
//            override fun selectedBackSpace(back: Emojicon) {
//                DisplayRules.backspace(  dataBinding.chatMsgInputBox.editTextBox)
//            }
//
//            override fun selectedFunction(index: Int) {
//                when (index) {
////                    0 -> goToAlbum()
////                    1 -> Toast.makeText(applicationContext, "跳转相机，只做演示", Toast.LENGTH_SHORT).show()
//                }
//            }
//        })
//
//        val faceCagegory: MutableList<String> = ArrayList()
//        val faceList = File("")
//        if (faceList.isDirectory) {
//            val faceFolderArray = faceList.listFiles()
//            for (folder in faceFolderArray) {
//                if (!folder.isHidden) {
//                    faceCagegory.add(folder.absolutePath)
//                }
//            }
//        }
//        dataBinding.chatMsgInputBox.setFaceData(faceCagegory)
//    }
//
//    override fun onResume() {
//        super.onResume()
//        if (! dataBinding.chatMsgInputBox.hasFocus()) {
//            dataBinding.chatMsgInputBox.requestFocus();
//        }
//    }
////    override fun onBackPressed() {
////        super.onBackPressed()
////        overridePendingTransition(0, R.anim.slide_out_down);
////
////    }
//    override fun finish() {
//        super.finish()
//        overridePendingTransition(0, com.luck.picture.lib.R.anim.ps_anim_down_out)
//    }
//
//
//
//}